home *** CD-ROM | disk | FTP | other *** search
- * PSNONPRI.PRG
- *
- * A DBASE II 16BIT COMMAND FILE to allow viewing non-priority tasks
- * (assigned priority 0) with the option of assigning a priority, thereby
- * moving them to the 'priority list'
- *
- * Version 1
- * By LTC Denny Hugg
- * ANGSC/DOS Andrews AFB MD 16 Jul 1985
- *
- * Version 2
- * modified by Maj Jim McMurry
- * ANGSC/DOSC Truax Field, WI 15 Jun 1986
- *
- * --- indexed on priority
- ERASE
- STORE 'M O V E N O N - P R I O R I T Y I T E M S' TO heading
- DO PSHEADING
- USE &gsusfile
- * --- find out what the record number of the last one is
- DO WHILE priority = '0.00'
- STORE # TO last
- SKIP
- ENDDO
- USE &gsusfile INDEX &gpryindex
- * --- see if there are any non-priority items
- FIND 0
- IF # = 0
- STORE 10 TO line
- STORE 'You Have No Non-Priority Items ' +gfirstname TO prompt
- DO PSPROMPT
- STORE 12 TO line
- STORE 'Returning To Priority Management Menu' TO prompt
- DO PSPROMPT
- STORE 0 TO timer
- DO WHILE timer < gdelay
- STORE timer + 1 TO timer
- ENDDO
- USE
- RELEASE ALL EXCEPT g*
- RETURN
- ELSE
- * --- a timer to keep the heading up awhile
- STORE 0 TO timer
- DO WHILE timer < gdelay
- STORE timer + 1 TO timer
- ENDDO
- ENDIF
- GO TOP
- * --- we want to know if he moved any items to the priority list
- STORE 'N' TO flag
- DO WHILE T
- STORE 0 TO counter
- ERASE
- STORE 1 TO line
- STORE 'NON - PRIORITY ITEMS' TO prompt
- DO PSPROMPT
- @ 4, 0 SAY 'Rec # Description'
- @ 4,70 SAY 'Due Date'
- @ 5, 0 SAY gline
- @ 5,78 SAY ' '
- * --- keep track of where we are in the file
- STORE # TO firstshown
- DO WHILE .NOT. EOF .AND. priority = '0.00' .AND. counter <15
- * --- display 15 records at a time
- DISPLAY ' ' + descrip +' ' + duedate
- SKIP
- STORE counter + 1 TO counter
- ENDDO
- STORE ' ' TO select
- @ 0, 0 SAY gcuron
- @ 22,79 SAY ' ';
- +'Enter Record # Of Item To Move To Priority List ';
- +'Or <RETURN> To Continue ';
- GET select PICTURE '99999'
- READ NOUPDATE
- @ 0, 0 SAY gcuroff
- @ 22,79 SAY gclearline
- IF select = ' '
- * --- this is the only exit as we want him reviewing all non priorities
- IF EOF .OR. priority <> '0.00'
- ERASE
- STORE 10 TO line
- STORE 'Thats The End Of Your Non-Priority Items ';
- +gfirstname TO prompt
- DO PSPROMPT
- STORE 12 TO line
- IF flag = 'N'
- STORE 'Returning To Priority Management Menu' TO prompt
- ELSE
- STORE 'Proceeding To View Your Priorities' TO prompt
- ENDIF
- DO PSPROMPT
- STORE 0 TO timer
- DO WHILE timer < gdelay
- STORE timer + 1 TO timer
- ENDDO
- IF flag = 'Y'
- * --- let him look at the lineup
- DO PSVIEWPR
- RETURN
- ELSE
- RETURN
- ENDIF
- ELSE
- * --- go back and display some more records
- LOOP
- ENDIF
- ELSE
- IF $(select,1,1) = ' '
- * --- he added some leading space(s)
- STORE 1 TO pointer
- * --- locate the first non-empty character
- DO WHILE $(select,pointer,1) = ' '
- STORE pointer + 1 TO pointer
- ENDDO
- * --- get the non-empty characters
- STORE $(select,pointer,LEN(select)-pointer + 1) TO select
- ENDIF
- * --- make it pretty for display purposes
- STORE TRIM(select) TO recno
- RELEASE select
- STORE '0000' TO zeros
- STORE $(zeros,1,5-LEN(recno)) + recno TO recno
- * --- make sure he doesn't enter a bogus record number
- * --- he can, however, pick from something other than that displayed
- * --- someday use an array of those records displayed to check this
- IF VAL(recno) > last
- @ 22,79 SAY gclearline
- @ 22,79 SAY ' ';
- + 'There Is No ' + recno + ' On The Non-Priority List'
- STORE 1 TO timer
- DO WHILE timer < gdelay
- STORE timer + 1 TO timer
- ENDDO
- * --- re-display the records so he can figure it out
- GO firstshown
- LOOP
- ENDIF
- GO VAL(recno)
- STORE ' ' TO mpriority
- @ 22,79 SAY ' '+;
- 'What Priority Would You Like To Assign Record '+recno+'? ';
- GET mpriority PICTURE '9.99'
- READ NOUPDATE
- * --- add the 0's since it's a character field
- STORE TRIM(mpriority) TO mpriority
- IF mpriority = ' .'
- STORE '0.00' TO mpriority
- ELSE
- STORE '00' TO zeros
- STORE mpriority + $(zeros,1,4-LEN(mpriority)) TO mpriority
- ENDIF
- IF mpriority <> priority
- REPLACE priority with mpriority
- * --- he'll go to view next
- STORE 'Y' TO flag
- * --- we want to give him another chance at the earlier non-prio's
- GO TOP
- ELSE
- * --- he dicked it up - redisplay it the same way
- GO firstshown
- ENDIF
- ENDIF
- ENDDO T
- * EOF PSNONPRI.PRG
-